package com.geovis.emergency.spd.entity.pc.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.geovis.emergency.spd.entity.basic.entity.BaseSpdEntity;
import com.geovis.emergency.spd.entity.pc.pojo.enums.StatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 应急预案指挥模块-消息通知
 * </p>
 *
 * @author 曾德实
 * @since 2022-04-30
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("pc_message")
@ApiModel(value = "PcMessage对象", description = "应急预案指挥模块-消息通知")
public class PcMessage extends BaseSpdEntity {

    @ApiModelProperty("演练id")
    private String pcDrillId;

    @ApiModelProperty("类型")
    private String type;

    @ApiModelProperty("标题")
    private String title;

    @ApiModelProperty("内容")
    private String content;

    @ApiModelProperty("0.未读 1.已读")
    private String status;

    @ApiModelProperty("关联pcID")
    private String relatedId;

    @ApiModelProperty("发送人id")
    @TableField(fill = FieldFill.INSERT)
    private String senderId;

    @ApiModelProperty("接收人id")
    private String acceptId;

    public static PcMessage newInstance(String type,String title,String content,String pcDrillId,String relatedId){
        return new PcMessage()
                .setPcDrillId(pcDrillId)
                .setRelatedId(relatedId)
                .setType(type)
                .setTitle(title)
                .setContent(content)
                .setStatus(StatusEnum.FALSE.getCode());
    }
}
